<?php $aPath = Yii::app()->theme->baseUrl . '/assets/'; ?>
<header class="header">
    <div class="header__top-panel">
        <div class="header__top-panel__left">
            <span class="header__top-panel__left__address">
                <a href="#your-city-popup" class="fancybox"><?php if (isset(Yii::app()->session['userRegion']['city'])) print Yii::app()->session['userRegion']['city']; ?></a>
            </span>
            <div class="your-city-popup" id="your-city-popup">
                <h3 class="popup-title">Выберите ваш город</h3>
                <ul class="your-city-popup__list">
                    <?php
                    foreach (Yii::app()->params['regions'] as $region) {
                        $class = '';
                        if ($region['regionId'] == Yii::app()->session['userRegion']['id']) {
                            $class = ' class="selected" ';
                        }
                        echo '<li ' . $class . '><a href="#"><span data-id="' . $region['regionId'] . '">' . $region['regionTitle'] . '</span></a></li>';
                    }
                    $defaultRegion = mTools::getDefaultRegion();

                    echo '<li><a href="#"><span data-id="' . $defaultRegion['regionId'] . '">Другой город</span></a></li>';
                    ?>
                </ul>	
            </div>
            <div class="sliderkit logo">
                <div class="sliderkit-panels">
                    <div class="sliderkit-panel">
                        <a href="/">ремонт ноутбуков</a>
                    </div>
                    <div class="sliderkit-panel">
                        <a href="/">ремонт компьютеров</a>
                    </div>
                    <div class="sliderkit-panel">
                        <a href="/">ремонт сотовых телефонов</a>
                    </div>
                    <div class="sliderkit-panel">
                        <a href="/">компьютерная помощь</a>
                    </div>       
                </div>
            </div>
        </div>
        <div class="header__top-panel__right">
            <div class="user-panel">
                <span class="user-panel__button">&nbsp;</span>
                <ul>
                    <?php if (Yii::app()->user->isGuest): ?>
                        <li class="user-panel__login">
                            <a href="/main/ajax/loadForm?formName=login&modelName=LoginForm" class="fancybox fancybox.ajax">Войти</a>
                        </li>
                        <li class="user-panel__registration">
                            <a href="/main/ajax/loadForm?formName=registration&modelName=Registration&scenario=create" class="fancybox fancybox.ajax">Зарегистрироваться</a>
                        </li>
                    <?php else: ?>
                        <li class="user-panel__login">
                            <a><?php echo Yii::app()->user->name['userName']; ?></a>
                        </li>
                        <li class="user-panel__registration">
                            <a href="/logout">Выйти</a>
                        </li>
                        <?php
                        if (!Yii::app()->user->isGuest && (Yii::app()->user->name['userGroup'] == 'admin' || Yii::app()->user->name['userGroup'] == 'moder')) {
                            echo '<li><a href="/x8">Админка</a></li>';
                        }
                        ?>
                    <?php endif; ?>
                </ul>
            </div>    
            <div class="phone">
                <a  class="phone__inner fancybox" href="#contacts-info">
                    
                    <span class="phone__number">
                        <?php if (isset(Yii::app()->session['userRegion']['city'])) echo Yii::app()->params['regions'][Yii::app()->session['userRegion']['id']]['tel']; ?>
                    </span>
                    <span class="phone__text">
                        Колл центр работает
                    </span>
                    <span class="phone__text">
                        <?php if (isset(Yii::app()->session['userRegion']['city'])) echo Yii::app()->params['regions'][Yii::app()->session['userRegion']['id']]['wtime']; ?>
                    </span>
                    <span class="phone__text"><strong style="color: green;"> <?php echo date('Y-m-d') == '2015-01-01' ? 'БУДЕМ РАБОТАТЬ - ЗАВТРА' : 'СЕГОДНЯ - МЫ РАБОТАЕМ'; ?></strong><strong></strong></span>
                </a>  
            </div>
            <?php $this->widget('application.modules.main.widgets.Contact'); ?>
        </div>
        <div class="header__top-panel__center">
            <div class="header__top-panel__center__inner">
                <div class="header__top-panel__navi">
                    <span class="header__top-panel__navi__section">
                        <span class="header__top-panel__navi__section__button">&nbsp;</span>
                        <span class="header__top-panel__navi__section__text"></span>
                    </span>  
                    <div class="header__top-panel__navi__list">
                        <dl class="your-city">
                            <dt>Ваш город:</dt>
                            <dd>
                                <span class="header__top-panel__left__address">
                                    <a class="fancybox fancybox.ajax" href="/main/ajax/getRegions"><?php if (isset(Yii::app()->session['userRegion']['city'])) print Yii::app()->session['userRegion']['city']; ?></a>
                                </span>
                            </dd>
                        </dl>
                        <ul class="header__top-panel__navi__inner">
                            <li class="header__top-panel__navi__item">
                                <a class="header__top-panel__navi__link" href="/company">О нас</a>
                                <div class="header__top-panel__navi__sublist">
                                    <ul>
                                        <!--										<li>
                                                                                                                                <a href="/garantiynye-obyazatelstva">Гарантийные обязательства</a>
                                                                                                                        </li>-->
                                        <li>
                                            <a href="/servis-centr">Сервис центры</a>
                                        </li>
                                        <li>
                                            <a href="/bonus">Акции</a>
                                        </li>
                                        <li>
                                            <a href="/remontiruem-sami">Статьи</a>
                                        </li>
                                        <li>
                                            <a href="/uslugi">Дополнительные услуги</a>
                                        </li>
                                        <!--										<li>
                                                                                                                                <a href="/company-person">Лица компании</a>
                                                                                                                        </li>									-->
                                        <li>
                                            <a href="/nashe-oborudovaniye">Наше оборудование</a>
                                        </li>	
                                        <li>
                                            <a href="/qa">Вопросы-ответы</a>
                                        </li>
                                    </ul>  
                                </div>      
                            </li>
                            <li class="header__top-panel__navi__item">
                                <a class="header__top-panel__navi__link" href="/vakansii"><b>Вакансии</b></a>
                            </li>
                            <li class="header__top-panel__navi__item">
                                <a class="header__top-panel__navi__link" href="/news">Новости</a>
                            </li>
                            <li class="header__top-panel__navi__item">
                                <a class="header__top-panel__navi__link" href="/otzivi">Отзывы</a>
                            </li>
                            <li class="header__top-panel__navi__item hiding">
                                <a class="header__top-panel__navi__link" href="/for-partners">Партнерам</a>
                            </li>
<!--                            <li class="header__top-panel__navi__item hiding">
                                <a class="header__top-panel__navi__link" href="/dlya-postavshikov">Для поставщиков</a>
                            </li>-->
                            <li class="header__top-panel__navi__item">
                                <a class="header__top-panel__navi__link" href="/kontakty">Контакты</a>
                            </li>
                        </ul>
                    </div>    
                </div>
                <div class="search-form">
                    <span class="search-form__button">&nbsp;</span>
                    <form action="/search">
                        <fieldset class="search-form__type-text">
                            <div class="search-form__type-text__inner">
                                <input value="<?php echo (empty($_GET['text']) ? '' : $_GET['text']); ?>" type="text" name ="text" lang="ru-RU" x-webkit-speech="" placeholder="Поиск" />
                            </div>  
                        </fieldset>

                        <fieldset class="search-form__type-submit">
                            <input type="submit" value="Найти" />
                        </fieldset>
                        <input type="hidden" name="searchid" value="2141635">
                        <input type="hidden" name="web" value="0">
                    </form>
                </div>
            </div>    
        </div>
    </div>
    <div class="main-navi">
        <div class="main-navi__inner">
            <span class="main-navi__button">Ещё</span>
            <?php print $this->getMenu("main-navi__list"); ?>
            <div class="main-navi__drop-down">
                <?php print $this->getMenu(); ?>
            </div>    
        </div>    
    </div>
</header>